#include <stdio.h>
#include <unistd.h>
#include "ui.h"
#include "touch.h"

int main(void)
{
    dev_init();
    draw_main_ui();
    while (1)
    {
        TouchPoint p = get_touch_data(ts_fd);
        if (p.valid == 2)
        {
            int idx = get_button_index(p.x, p.y);
            if (idx != -1)
            {
                handle_button(idx, p.x, p.y);
            }
        }
    }
    dev_uninit();
    return 0;
}